<template>
  <div class="container">
    <!-- 内容部分 -->
    <div class="operate">
      <slot></slot>
      <div style="margin-right: auto"></div>
      <slot name="op"></slot>
    </div>
    <div class="content" :style="{ maxHeight: item.h * 40 - 80 + 'px' }">
      <Chart :spec="spec" />
    </div>
  </div>
</template>

<script setup lang="ts">
  /**
   * @description 业务组件 -- 公告
   */
  import { defineProps } from "vue";
  import Chart from "./Chart.vue";
  defineProps(["item"]);
  const spec = {
    type: "area",
    data: {
      values: [
        {
          time: "2:00",
          value: 8,
        },
        {
          time: "4:00",
          value: 9,
        },
        {
          time: "6:00",
          value: 11,
        },
        {
          time: "8:00",
          value: 14,
        },
        {
          time: "10:00",
          value: 16,
        },
        {
          time: "12:00",
          value: 17,
        },
        {
          time: "14:00",
          value: 17,
        },
        {
          time: "16:00",
          value: 16,
        },
        {
          time: "18:00",
          value: 15,
        },
      ],
    },
    xField: "time",
    yField: "value",
  };
</script>

<style scoped lang="scss">
  .container {
    user-select: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0px 10px 10px;
    font-size: 14px;
    color: #999;
    .content {
      flex: 1;
      display: flex;
      flex-direction: column;
      margin-top: 10px;
      overflow: hidden;
    }
  }

  .content-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }
  .content-item-main {
    display: flex;
    flex-direction: column;
  }
  .operate {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }
</style>
